<? ob_start(); ?>
<?php
 $i = 0;
 $mid="crap";
 $rid="not found";
 $url="";
 $urltag = FALSE;
    foreach($_GET as $key => $value) {
        $i++;
		if($i == 1) {echo $key ."------".$value;}
		if($key == "rid") { $rid = $value; }
		elseif ($urltag == TRUE ) { $url .="&". $key."=".$value;}
		elseif($key == "url") {
		$urltag = TRUE;
		$url .= $value .= "?";} 
    } 
 $db = mysql_connect("mysql513.in.shared-server.net:16033", "JRtu434", "qvoiceDB1");
 $ip=$_SERVER['REMOTE_ADDR'];
 echo "URL= " .$url;
 echo "rid= " .$rid;
 echo "mid= " .$mid;
?>
<? ob_flush(); ?> 
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> 
<html lang="ja"> 
 
<!-- ==== document header ==== --> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
<meta http-equiv="Content-Style-Type" content="text/css"> 
<meta http-equiv="Content-Script-Type" content="text/javascript"> 
<title>アンケート画面に移動します</title> 
</head> 
<?php
 if ($item == false){
  echo "URLが不正です。";
 } else {
  echo "アンケート画面に移動します。<br>画面がかわらない方は、<a href='" . $nurl . "'>こちら</a>をクリックしてください。";
 }
?>
</html>